//
//  SoldCell.m
//  KiklinkApp
//
//  Created by LJC on 14-10-9.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import "SoldCell.h"

@implementation SoldCell

- (void)awakeFromNib
{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)loadData
{
    self.buyer.text = @"地对地导弹的";
    self.productName.text = @"噶飒飒大师大师的";
    self.payDate.text = @"2014/09/24";
}

- (void)loadDataWithSold:(SellRecord *)sellRecord
{
    self.buyer.text = sellRecord.ext1;
    self.productName.text = sellRecord.productName;
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"YYYY/MM/dd"];
    
    NSDate *payDate = [NSDate dateWithTimeIntervalSince1970:(long long)(sellRecord.createtimelong/1000)];
    NSString *payDateStr = [formatter stringFromDate:payDate];
    
    self.payDate.text = payDateStr;
}

@end
